import request from '@/utils/request'

// 查询销售订单列表
export function listSalesOrder(query) {
  return request({
    url: '/ldzl-sc/sc/salesOrder/list',
    method: 'get',
    params: query
  })
}

// 查询销售订单明细
export function getSalesOrderDetail(salesOrderId) {
  return request({
    url: '/ldzl-sc/sc/salesOrder/detail/' + salesOrderId,
    method: 'get'
  })
}

// 查询销售订单详细信息
export function getSalesOrder(id) {
  return request({
    url: '/ldzl-sc/sc/salesOrder/' + id,
    method: 'get'
  })
}

// 新增销售订单
export function addSalesOrder(data) {
  return request({
    url: '/ldzl-sc/sc/salesOrder',
    method: 'post',
    headers: {
      repeatSubmit: false  // 禁用防重复提交检查
    },
    data: data
  })
}

// 修改销售订单
export function updateSalesOrder(data) {
  return request({
    url: '/ldzl-sc/sc/salesOrder',
    method: 'put',
    data: data
  })
}

// 删除销售订单
export function delSalesOrder(id) {
  return request({
    url: '/ldzl-sc/sc/salesOrder/' + id,
    method: 'delete'
  })
}

// 导出销售订单
export function exportSalesOrder(query) {
  return request({
    url: '/ldzl-sc/sc/salesOrder/export',
    method: 'get',
    params: query
  })
} 